<?php

use Phinx\Migration\AbstractMigration;
use Phinx\Db\Adapter\MysqlAdapter;

class Holidays extends AbstractMigration
{
    public function up()
    {
        $users = $this->table('holidays', array('comment' => '中国节假日'));
        $users->addColumn('datetimes', 'date')
              ->addColumn('year', 'string')
              ->addColumn('month', 'string')
              ->addColumn('day', 'string')
              ->addColumn('is_holiday', 'integer', array('limit' => MysqlAdapter::INT_TINY, 'default' => 0))
              ->addColumn('profiles', 'string', array('null' => true))
              ->addIndex('datetimes')
              ->save();     
    }

    /**
     * Migrate Down.
     */
    public function down()
    {
        $this->dropTable('holidays');
    }
}
